from django.test import TestCase
import stri
# Create your tests here.


class Enemy:
    def __init__(self, name="", atk=0, hp=0):
        self.name = name
        self.atk = atk
        self.hp = hp

    @property
    def atk(self):
        return self._atk

    @atk.setter
    def atk(self, value):
        print(value)
        if 0 <= value <= 100:
            self._atk = value
        else:
            raise Exception('超出攻击范围')


e = Enemy('AK')
# print(e.atk)
e.atk = 10